﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MovieDB.Web.Html
{
    public static class MessageHelper
    {
        public const string TempDataMessageKey = "TempDataMessageKey";

        public static bool IsMessageExists(this TempDataDictionary tempData)
        {
            var message = (string)tempData[TempDataMessageKey];
            return (message != null);
        }

        public static string GetMessage(this TempDataDictionary tempData)
        {
            return (string) tempData[TempDataMessageKey];
        }
    }
}